

require(["config"],function(){
	require(["jquery","com","own","list"],function(jquery,com,own,list){
		$(".custom ul li").hover(function(){
			$(this).find("p").css({"display":"block"}).stop().animate({"top":0},300);
		},function(){
			$(this).find("p").stop().animate({"top":"310"},300,function(){
				$(this).hide();
			});
		})
		com(own);
		list(own,"pat");
		list(own,"rainbow");
		list(own,"custom");
		list(own,"creative");
		list(own,"imported");
		list(own,"domestic");
		var now = 0;
		var flag = true;
		function ban(){
			$("#banner ul li").each(function(){
				$(this).css({
					"width":"2200",
					"height":"640",
					"top":"-50px",
					"left":"-150px"
				}).removeClass("current");
			})
			$("#banner ul li").eq(now).addClass("current").stop().animate({
				"width":"1900",
				"height":"541",
				"top":"0",
				"left":"0"
			},5000)
			$("#banner ol li").eq(now).addClass("on").siblings().removeClass("on");
			now++;
			if(now == 4){
				now = 0;
			}
		}
		var timer = setInterval(ban,5000);
		ban();
		$("#banner").mouseover(function(){
			clearInterval(timer);
			flag = false;
		})
		$("#banner").mouseout(function(){
			timer = setInterval(ban,5000);
			flag = true;
		})
		$("#banner ol li").each(function(){
			$(this).mouseover(function(){
				now = $(this).index();
				ban();
			})
		})
		$("#sbr ul li").not(".sbr_p").hover(function(){
			$(this).css({"background":"#e51e13"});
			$(this).children("a").stop().animate({"left":"-150px"},300);
		},function(){
			$(this).css({"background":"#fff"});
			$(this).children("a").stop().animate({"left":"0px"},300);
		})
		$("#sbr ul .sbr_p").hover(function(){
			$(this).children("p").css({"display":"block"});
		},function(){
			$(this).children("p").css({"display":"none"});
		})
		$(window).scroll(function(){
			var top = $(this).scrollTop();
			if(top > 500){
				$("#sbr").css({"display":"block"}).stop().animate({"right":"0"},300);
			}else{
				$("#sbr").stop().animate({"right":"-40px"},300,function(){
					$(this).css({"display":"none"});
				});
			}
			$("#sbr .hddb").on("click",function(){
				$("body,html").stop().animate({"scrollTop":"0"},500);
			})
		})
	})
})
